#ifndef __DRV_DUO_H__
#define __DRV_DUO_H__
#include <stm32f4xx.h>

// 状态机相关
typedef enum {
    STATE_IDLE,
    STATE_STANDUP,
    STATE_LIEDOWN,
    STATE_FRONT,
    STATE_BACK
} DogState;

extern DogState current_state;
extern uint8_t action_step;
extern uint16_t action_counter;
extern uint8_t action_repeat_count;

void update_dog_action(void);
void reset_dog_action(void);

void TIM1_INIT(void);
//舵机角度
void setservo_angle(uint8_t servo,uint16_t angle);
uint16_t mapangletopulse(uint16_t angle);

void action_standup(void);
void action_liedown(void);
void action_front(void);
void dance(void);
void action_back(void);


#endif
